Mimer SQL Data Provider
GetSchema(String,String[]) Method
Example 




Mimer.Data.Client Namespace > MimerConnection Class > GetSchema Method : GetSchema(String,String[]) Method
The name of the schema to return.
An array of restriction values for the current schema.
Retrieve schema information for the current connection.
Syntax
'Declaration
 
Public Overloads Overrides NotOverridable Function GetSchema( _
   ByVal collectionName As String, _
   ByVal restrictionValues() As String _
) As DataTable
public override DataTable GetSchema( 
   string collectionName,
   string[] restrictionValues
)
public function GetSchema( 
    collectionName: String;
    restrictionValues: Stringarray of
): DataTable; override; 
public override function GetSchema( 
   collectionName : String,
   restrictionValues : String[]
) : DataTable;
public: DataTable* GetSchema( 
   string* collectionName,
   string*[]* restrictionValues
) override 

Parameters

collectionName
The name of the schema to return.
restrictionValues
An array of restriction values for the current schema.

Return Value

A System.Data.DataTable with the requested information.
Remarks
The following collection names are currently supported:
Collection Description
MetaDataCollections A schema collection that lists the available metadata collections.

This collection has no restriction fields.

DataSourceInformation A schema collection with information about identifier formats and other information to allow portable SQL to be used.

This collection has no restriction fields.

DataTypes A schema collection with information about available data types.

This collection has no restriction fields.

Restrictions A schema collection with information about restrictions supported by the provider.

This collection has no restriction fields.

ReservedWords A schema collection a list of SQL reserved words.

This collection has no restriction fields.

Idents A schema collection with a list of users that the current user is allowed to see.

This collection has one restriction field: IDENT_NAME.

Tables A schema collection with a list of tables that the current user is allowed to see.

This collection has the following restriction fields: TABLE_SCHEMA, TABLE_NAME.

Columns A schema collection with a list of columns for tables and views that the current user is allowed to see.

This collection has the following restriction fields: TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME.

Views A schema collection with a list of tables that the current user is allowed to see.

This collection has the following restriction fields: VIEW_SCHEMA, VIEW_NAME

ProcedureColumns A schema collection with a list of columns from procedures that return a result set that the current users is allowed to see.

This collection has the following restriction fields: ROUTINE_SCHEMA, ROUTINE_NAME, PARAMETER_NAME.

Procedures A schema collection with a list of procedures that the current user is allowed to see.

This collection has the following restriction fields: ROUTINE_SCHEMA, ROUTINE_NAME.

ProcedureParameters A schema collection with a list of procedure parameters for procedures that the current user is allowed to see.

This collection has the follwoing restriction fields: ROUTINE_SCHEMA, ROUTINE_NAME, PARAMETER_NAME.

Functions A schema collection with a list of functions that the current user is allowed to see.

This collection has the following restriction fields: ROUTINE_SCHEMA, ROUTINE_NAME.

FunctionParameters A schema collection with a list of function parameters and return values for functions that the current user is allowed to see.

This collection has the following restriction fields: ROUTINE_SCHEMA, ROUTINE_NAME, PARAMETER_NAME.

PrimaryUniqueKeys A schema collection with a list of primary and unique keys for tables that the current user is allowed to see.

This collection has the following restriction fields: TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_NAME.

PrimaryUniqueKeyColumns A schema collection with a list of columns for primary and unique keys for tables that the current user is allowed to see.

This collection has the following restriction fields: TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME.

ForeignKeys A schema collection with a list of foreign keys that the current user is allowed to see.

This collection has the following restriction fields: TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_NAME.

ForeignKeyColumns A schema collection with a list of foreign key columns that the current user is allowed to see.

This collection has the following restriction fields: TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME.

Indexes A schema collection with a list of indexes for tables the current user is allowed to see.

This collection has the following restriction fields: TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_NAME.

IndexColumns A schema collection with a list of index columns for tables the current user is allowed to see.

This collection has the following restriction fields: TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_NAME, INDEX_COLUMN.

Synonyms A schema collection with a list of all synonyms the current user is allowed to see.

This collection has the following restriction fields: SYNONYM_SCHEMA, SYNONYM_NAME.

Sequences A schema collection with a list of sequences the current user is allowed to see.

This collection has the following restriction fields: SEQUENCE_SCHEMA, SEQUENCE_NAME.

Triggers A schema collection with a list of triggers for tables and views the current user is allowed to see.

This collection has the following restriction fields: TABLE_SCHEMA, TRIGGER_NAME, TABLE_NAME.

Schemas A schema collection with a list of schemas the current user is allowed to see.

This collection has no restriction fields.

CheckConstraints A schema collection with a list of check constraints for tables the current user is allowed to see.

This collection has the following restriction fields: TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_NAME.

Domains A schema collection with a list of domains the current user is allowed to see.

This collection has the following restriction fields: DOMAIN_SCHEMA, DOMAIN_NAME.

Collations A schema collection with a list of collations that may be used by the current user.

This collection has the following restriction fields: COLLATION_SCHEMA, COLLATION_NAME.

Statements A schema collection with a list of precompiled SQL-statements the current user is allowed to see.

This collection has the following restriction fields: STATEMENT_SCHEMA, STATEMENT_NAME.

The restrictionValues can be null, or an array of string values where the restriction fields are listed above. This information should be obtained dynamically by using the Restrictions schema table. This way the application will not be dependent on future changes.

Example

No example is available for C++ or JScript. To view a C# or Visual Basic example, click the Language Filter button in the upper-left corner of the page.

MimerConnection connection = new MimerConnection();
// 
//  Open a connection to the database server ExampleDB on the same node (local) as the client
// 
connection.ConnectionString = "Database=ExampleDB;Protocol=local;User Id=MIMER_STORE;Password=GoodiesAreUs";
try {
    connection.Open();
    string [] restrictionValues = new string[2];
    restrictionValues[0] = "SCHEMA";  // Schema name
    restrictionValues[1] = null;      // Table name
    //
    //  Get a DataTable with all tables owned by the ident SCHEMA
    //
    DataTable metaData = connection.GetSchema("Tables", restrictionValues);
} finally {
    if (connection.State != ConnectionState.Closed) {
        connection.Close();
    }
}
Dim connection As New MimerConnection
'
'  Open a connection to the database server ExampleDB on the same node (local) as the client
'
connection.ConnectionString = "Database=ExampleDB;Protocol=local;User Id=MIMER_STORE;Password=GoodiesAreUs"
Try
    connection.Open()
    Dim restrictionValues As new string(2)
    restrictionValues(0) = "SCHEMA"
    restrictionValues(1) = Nothing
    '
    '  Get a DataTable with all tables owned by the ident SCHEMA
    '
    Dim metaData As DataTable = connection.GetSchema("Tables", restrictionValues)
Finally 
    If Not connection.State = ConnectionState.Closed Then
        connection.Close()
    End If
End Try
Requirements

.NET Framework
Version 2.0 or later

See Also

Reference

MimerConnection Class
MimerConnection Members
Overload List